package com.newtouch.bxzs.policy.controller;

import com.newtouch.bxzs.common.base.response.BaseResponse;
import com.newtouch.bxzs.common.base.response.RespGenerator;
import com.newtouch.bxzs.policy.model.bo.*;
import com.newtouch.bxzs.policy.model.vo.*;
import com.newtouch.bxzs.policy.service.PolicyInsuranceService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

/**
 * 银行端调保险端保单管理controller层
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/7 10:12</td>
 * <td>linhongxi</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author linhongxi
 * @version 1.0.0
 * @since 1.0.0
 */
@ApiIgnore
@RestController
@SuppressWarnings("unchecked")
@RequestMapping("/policyInsurance")
public class PolicyInsuranceController {
    /** 静态变量：系统日志 */
    private static final Log logger = LogFactory.getLog(PolicyInsuranceController.class);

    @Resource
    private PolicyInsuranceService policyInsuranceService;

    @PostMapping("/getIndividualPolicyInfoInsurance")
    public BaseResponse<PolicyBO> individualPolicyInfoInsurance(@RequestBody PolicyInfoVO policyInfoVO) {
        logger.info("查询个人保单详情");
        return RespGenerator.returnOK(policyInsuranceService.getIndividualPolicyInfoInsurance(policyInfoVO));
    }

    @PostMapping(value = "/getIndividualPolicyPreservationInsurance")
    public BaseResponse<PreservationBO> individualPolicyPreservationInsurance(@RequestBody PolicyInfoPageVO policyInfoPageVO) {
        logger.info("调用查询个人保全信息外部接口");
        return RespGenerator.returnOK(policyInsuranceService.getPolicyPreservationInsurance(policyInfoPageVO));
    }

    @PostMapping(value = "/getIndividualPolicyClaimsInsurance")
    public BaseResponse<ClaimsBO> individualPolicyClaimsInsurance(@RequestBody PolicyInfoPageVO policyInfoPageVO) {
        logger.info("调用查询个人理赔信息外部接口");
        return RespGenerator.returnOK(policyInsuranceService.getPolicyClaimsInsurance(policyInfoPageVO));
    }

    @PostMapping(value = "/getPreservationListInsurance")
    public BaseResponse<PreservationProgressListBO> preservationListInsurance(@RequestBody PreservationVO preservationVO) {
        logger.info("查询个单保全进度列表");
        return RespGenerator.returnOK(policyInsuranceService.getPreservationProgressListInsurance(preservationVO));
    }

    @PostMapping(value = "/getPreservationInfoInsurance")
    public BaseResponse<PreservationProgressInfoBO> preservationInfoInsurance(@RequestBody PreservationProgressInfoVO preservationProgressInfoVO) {
        logger.info("查看个单保全进度详情");
        return RespGenerator.returnOK(policyInsuranceService.getPreservationProgressInfoInsurance(preservationProgressInfoVO));
    }

    @PostMapping(value = "/getClaimsProgressListInsurance")
    public BaseResponse<ClaimsProgressListBO> claimsProgressListInsurance(@RequestBody ClaimsVO claimsVO) {
        logger.info("查询个单理赔进度列表");
        return RespGenerator.returnOK(policyInsuranceService.getClaimsProgressListInsurance(claimsVO));
    }

    @PostMapping(value = "/getPolicyNewContractInfoInsurance")
    public BaseResponse<PolicyNewContractInfoBO> policyNewContractInfoInsurance(@RequestBody PolicyNewContractInfoVO policyNewContractInfoVO) {
        logger.info("查看个单新契约详情");
        return RespGenerator.returnOK(policyInsuranceService.getPolicyNewContractInfoInsurance(policyNewContractInfoVO));
    }

    @PostMapping(value = "/getPolicyNewContractListInsurance")
    public BaseResponse<PolicyNewContractListBO> policyNewContractListInsurance(@RequestBody PolicyNewContractVO policyNewContractVO) {
        logger.info("查询个单新契约列表");
        return RespGenerator.returnOK(policyInsuranceService.getPolicyNewContractListInsurance(policyNewContractVO));
    }

    @PostMapping(value = "/getExpirationPolicyListInsurance")
    public BaseResponse<ExpirationPolicyBO> expirationPolicyListInsurance(@RequestBody ExpirationPolicyVO expirationPolicyVO) {
        logger.info("查询个单满期信息列表");
        return RespGenerator.returnOK(policyInsuranceService.getExpirationPolicyListInsurance(expirationPolicyVO));
    }

    @PostMapping(value = "/getRenewalPolicyListInsurance")
    public BaseResponse<RenewalPolicyListBO> renewalPolicyListInsurance(@RequestBody RenewalPolicyVO renewalPolicyVO) {
        logger.info("查询个单续期信息列表");
        return RespGenerator.returnOK(policyInsuranceService.getRenewalPolicyListInsurance(renewalPolicyVO));
    }

}
